From 025b03a2336e6c6db85a3720c2c7c68a714eb25f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fabian=20Gr=C3=BCnbichler?= Date: Wed, 23 Apr 2025 18:18:51 +0200 Subject: [PATCH] [PATCH 2/2] control: make Multi-Arch configurable MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit to allow overriding if needed, without the need to override all of debian/control. Signed-off-by: Fabian Grünbichler Gbp-Pq: Name 0002-control-make-Multi-Arch-configurable.patch --- debcargo.toml.example | 4 ++++ src/config.rs | 5 +++++ src/debian/control.rs | 3 +++ 3 files changed, 12 insertions(+) diff --git a/debcargo.toml.example b/debcargo.toml.example index 862b6c2..da55db0 100644 --- a/debcargo.toml.example +++ b/debcargo.toml.example @@ -196,6 +196,10 @@ uploaders = [ "foo bar " ] #PLACEHOLDER #""" +# Value for the Multi-Arch field of the package. If omitted, debcargo will +# automatically set no value for 'bin', and 'same' for all 'lib' packages. +#multi_arch = "no|same|foreign|allowed" + # Additional Depends on top of the ones generated by debcargo. This should be # used to pull in system libraries for crates that need them to build. You'll # want the -dev versions of the library packages, since our crate packages are diff --git a/src/config.rs b/src/config.rs index 773d739..f445e53 100644 --- a/src/config.rs +++ b/src/config.rs @@ -76,6 +76,7 @@ pub struct PackageOverride { section: Option, summary: Option, description: Option, + multi_arch: Option, depends: Option>, recommends: Option>, suggests: Option>, @@ -219,6 +220,10 @@ impl Config { self.with_package(key, |pkg| pkg.description.as_deref()) } + pub fn package_multi_arch(&self, key: PackageKey) -> Option<&str> { + self.with_package(key, |pkg| pkg.multi_arch.as_deref()) + } + pub fn package_depends(&self, key: PackageKey) -> Option<&Vec> { self.with_package(key, |pkg| pkg.depends.as_ref()) } diff --git a/src/debian/control.rs b/src/debian/control.rs index be745e7..eb46d81 100644 --- a/src/debian/control.rs +++ b/src/debian/control.rs @@ -589,6 +589,9 @@ impl Package { .flatten() .map(|s| s.to_string()), ); + if let Some(multi_arch) = config.package_multi_arch(key) { + self.multi_arch = Some(multi_arch.to_owned()); + } } } -- 2.30.2